from selenium.webdriver.common.by import By
from homework.ceshiren.framework.base_page import BasePage
from homework.ceshiren.page.search_page import SearchPage


class MainPage(BasePage):
    def __init__(self):
        super().__init__()
        self.driver.get("https://ceshiren.com/")

    def open_search(self):
        # 点击搜索
        self.click(By.CSS_SELECTOR, '#search-button')
        # 打开高级设置
        self.click(By.CSS_SELECTOR, '.widget-link.show-advanced-search')
        return SearchPage(self.driver)
